<template>
  <div class="hello">
    <h1>{{ msg }}</h1>
<!--    <h1>p1:{{ p1 }}</h1>-->
<!--    <h1>p2:{{ p2 }}</h1>-->
    <img alt="Vue logo" src="../assets/logo.png">
<!--    <div>-->
<!--      <button @click="show('a')">A页面</button>-->
<!--      <button @click="show('b')">B页面</button>-->
<!--    </div>-->
  </div>
</template>

<script>
export default {
  name: 'HelloWorld',
  props: {
    msg: String,
    p1: Number,
    p2: Number
  },
  methods: {
    show(index) {
      if(index === 'a') {
        this.$router.push('/a')
      }
      if(index === 'b') {
        this.$router.push('/b')
      }
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
